﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DataLayer;

namespace Manager
{
    public partial class frmDoviz : XtraForm
    {
        public frmDoviz()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Factory.GetFactory.ExecuteNonQuery("DELETE FROM CURRENCY");
            IDbDataParameter prm = Factory.GetFactory.GetParameter("@rate", DbType.Decimal);
            prm.Value = textBox1.Text;
            Factory.GetFactory.ExecuteNonQuery(CommandType.Text, "INSERT INTO CURRENCY () VALUES ('USD',@rate)", prm);
            prm.Value = textBox2.Text;
            Factory.GetFactory.ExecuteNonQuery(CommandType.Text, "INSERT INTO CURRENCY () VALUES ('EURO',@rate)", prm);
        }
    }
}
